import request from "@/utils/request";

// 获取管理员列表
export function getAdminList(params) {
  return request({
    url: "/system/admin/list",
    method: "get",
    params,
  });
}

// 创建管理员
export function createAdmin(data) {
  return request({
    url: "/system/admin/create",
    method: "post",
    data,
  });
}

// 更新管理员
export function updateAdmin(data) {
  return request({
    url: "/system/admin/update",
    method: "put",
    data,
  });
}

// 删除管理员
export function deleteAdmin(id) {
  return request({
    url: `/system/admin/delete/${id}`,
    method: "delete",
  });
}

// 更新管理员状态
export function updateAdminStatus(data) {
  return request({
    url: "/system/admin/status",
    method: "put",
    data,
  });
}

// 数据统计相关接口
export function getStatisticsData() {
  return request({
    url: "/system/statistics/overview",
    method: "get",
  });
}

export function getVisitData(params) {
  return request({
    url: "/system/statistics/visit",
    method: "get",
    params,
  });
}

export function getUserData(params) {
  return request({
    url: "/system/statistics/user",
    method: "get",
    params,
  });
}

export function getOrderData(params) {
  return request({
    url: "/system/statistics/order",
    method: "get",
    params,
  });
}

export function getSalesData(params) {
  return request({
    url: "/system/statistics/sales",
    method: "get",
    params,
  });
}
